package com.ly.datacenter.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ly.datacenter.http.util.HttpServletUtil;

public class TreeServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException {
		try {
			HttpServletUtil.configResponseJSON(request, response);
			PrintWriter writer = response.getWriter();
			writer.println("[{id:'grid',text:'数据表格',leaf:false, url:'data.html'},{id:'form',text:'表单提交',leaf:true, url:'tables.html'},{id:'html',text:'静态页面',leaf:true, url:'demo.html'}]");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
		doGet(req, resp);
	}

}
